﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Xml.Linq;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Web.Mvc;
using COM.Service;
using COM.Web;
using SampleApp.Service;
using COM.Data;

namespace SampleApp.Web.WcfService
{
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class SystemWcfService : ISystemWcfService
    {
        private IPermissionService permissionService = Unity.Instance.GetService<IPermissionService>();
        private IAppLogService appLogService = Unity.Instance.GetService<IAppLogService>();

        [WebInvoke]
        public DateTime GetServerDateTime()
        {
            return DateTime.Now;
        }

        [WebInvoke]
        public void Log(string applicationName, string category, string message)
        {
            appLogService.Log(applicationName, category, message);
        }

    }
}
